import type { postOrPutType } from "@/constants";
import type { HasId, IList, IResult } from "@/types/common";
import { getAxios, commonAxiosJson } from "@/utils/request.js";
/* 投资商地址 */
const url = "/admin/merchant/investors";
/* 获取投资商列表 */
export const getInvestorsList = <T, D>(params?: D): Promise<IResult<IList<T>>> => {
  return getAxios<IList<T>, D>(url, params);
};
/* 获取投资商详情信息 */
export const getInvestorsByIdInfo = <T, D extends HasId>(params: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url + "/" + params.id, params);
};
/* 新增修改投资商详情 */
export const commonInvestorsInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 投资商入驻直付通 */
export const putMerchantZftCreateInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/merchant-zft-create", params, "PUT");
};
/* 投资商修改直付通 */
export const putMerchantZftModifyInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/merchant-zft-modify", params, "PUT");
};
